<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Jumper</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>Jumper</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>


<h2>Modules</h2>
<ul>
  <li><strong>core.bheap</strong></li>
  <li><a href="../modules/core.grid.html">core.grid</a></li>
  <li><a href="../modules/core.heuristics.html">core.heuristics</a></li>
  <li><a href="../modules/core.node.html">core.node</a></li>
</ul>
<h2>Scripts</h2>
<ul>
  <li><a href="../scripts/init.html">init</a></li>
  <li><a href="../scripts/pathfinder.html">pathfinder</a></li>
  <li><a href="../scripts/search.astar.html">search.astar</a></li>
  <li><a href="../scripts/search.jps.html">search.jps</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>core.bheap</code></h1>

<p><strong>A light implementation of <code>binary heaps</code></strong>.</p>
<p> While running a search, <a href="http://en.wikipedia.org/wiki/A_star">A*</a> algorithm maintains a list of nodes called <strong>open list</strong>.
 Finding in this list the lowest cost node from the node being processed can be quite slow,
 (as it requires to skim through the collection of nodes stored in this list)
 especially when dozens of nodes are being processed (large maps). </p>

<p> The current modules implements the <a href="http://www.policyalmanac.org/games/binaryHeaps.htm">binary heap</a> data structure,
 from which the internal open list will be instantiated. As such, looking up for lower-cost
 node will run faster, and globally makes the search algorithm run faster.</p>

<p> This module should not normally be used explicitely. The algorithm uses it internally.</p>
    <h3>Info:</h3>
    <ul>
        <li><strong>Copyright</strong>: 2012-2013</li>
        <li><strong>License</strong>: <a href="http://www.opensource.org/licenses/mit-license.php">MIT</a></li>
        <li><strong>Author</strong>: Roland Yonaba</li>
    </ul>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#heap:empty">heap:empty&nbsp;()</a></td>
	<td class="summary">Checks if a <a href="../modules/core.bheap.html#heap">heap</a>  is empty</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#heap:clear">heap:clear&nbsp;()</a></td>
	<td class="summary">Clears the <a href="../modules/core.bheap.html#heap">heap</a>  (removes all items queued in the heap)</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#heap:push">heap:push&nbsp;(item)</a></td>
	<td class="summary">Adds a new item in the <a href="../modules/core.bheap.html#heap">heap</a> </td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#heap:pop">heap:pop&nbsp;()</a></td>
	<td class="summary">Pops from the <a href="../modules/core.bheap.html#heap">heap</a> .</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#heap:heapify">heap:heapify&nbsp;([item])</a></td>
	<td class="summary">Restores the <a href="../modules/core.bheap.html#heap">heap</a>  property.</td>
	</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#heap">heap</a></td>
	<td class="summary">The <a href="../modules/core.bheap.html#heap">heap</a>  class</td>
	</tr>
</table>

<br/>
<br/>


    <h2><a name="Functions"></a>Functions</h2>

    <dl class="function">
    <dt>
    <a name = "heap:empty"></a>
    <strong>heap:empty&nbsp;()</strong>
    </dt>
    <dd>
    Checks if a <a href="../modules/core.bheap.html#heap">heap</a>  is empty


    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">bool</span></span>
        <code>true</code> of no item is queued in the heap, <code>false</code> otherwise
    </ol>




</dd>
    <dt>
    <a name = "heap:clear"></a>
    <strong>heap:clear&nbsp;()</strong>
    </dt>
    <dd>
    Clears the <a href="../modules/core.bheap.html#heap">heap</a>  (removes all items queued in the heap)






</dd>
    <dt>
    <a name = "heap:push"></a>
    <strong>heap:push&nbsp;(item)</strong>
    </dt>
    <dd>
    Adds a new item in the <a href="../modules/core.bheap.html#heap">heap</a>

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">item</span>
        <span class="types"><span class="type">object</span></span>
       a new object to be queued in the heap</li>
    </ul>





</dd>
    <dt>
    <a name = "heap:pop"></a>
    <strong>heap:pop&nbsp;()</strong>
    </dt>
    <dd>
    Pops from the <a href="../modules/core.bheap.html#heap">heap</a> .
 Removes and returns the lowest cost item (with respect to the comparison function used) from the <a href="../modules/core.bheap.html#heap">heap</a> .


    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">object</span></span>
        an object stored in the heap
    </ol>




</dd>
    <dt>
    <a name = "heap:heapify"></a>
    <strong>heap:heapify&nbsp;([item])</strong>
    </dt>
    <dd>
    Restores the <a href="../modules/core.bheap.html#heap">heap</a>  property.
 Reorders the <a href="../modules/core.bheap.html#heap">heap</a>  with respect to the comparison function being used.
 When given arg <code>item</code>, will sort that very item in the <a href="../modules/core.bheap.html#heap">heap</a> .
 Otherwise, the whole <a href="../modules/core.bheap.html#heap">heap</a>  will be sorted.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">item</span>
        <span class="types"><span class="type">object</span></span>
       the modified object</li>
    </ul>





</dd>
</dl>
    <h2><a name="Tables"></a>Tables</h2>

    <dl class="function">
    <dt>
    <a name = "heap"></a>
    <strong>heap</strong>
    </dt>
    <dd>
    The <a href="../modules/core.bheap.html#heap">heap</a>  class






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.3</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
